<div class="box-body table-responsive no-padding">
    <table class="table">
        <thead>
        <tr>
            <th>账号</th>
            <th>SKU</th>
            <th>品名</th>
            <th>来源</th>
            <th>退货时间</th>
            <th>国家</th>
            <th>purchase date</th>
            <th>订单号</th>
            <th>平台SKU</th>
{{--            <th>ASIN</th>--}}
{{--            <th>FNSKU</th>--}}
            <th>数量</th>
{{--            <th>detailed disposition</th>--}}
{{--            <th>fulfillment center id</th>--}}
            <th>主要原因</th>
            <th>评论</th>
            <th>标签</th>
{{--            <th>状态</th>--}}
        </tr>
        </thead>
        <tbody>
        @foreach($paginator as $row)
            @php
                $sku = \App\Models\Product\ProductSku::getModelById($row->psku_id);
            @endphp
            <tr>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ \App\Models\Basics\SysPlatAccount::getAccountById($row->account_id) }}</span></td>
                <td>{{ $sku->psku_code ?? '' }}</td>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $sku->psku_cn ?? '' }}</span></td>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ '退货' }}</span></td>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->return_date }}</span></td>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ \App\Models\Basics\SysCountry::getCountryById($row->country_id) }}</span></td>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->purchase_date }}</span></td>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->order_id }}</span></td>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->sku }}</span></td>
{{--                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->asin }}</span></td>--}}
{{--                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->fnsku }}</span></td>--}}
                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->quantity }}</span></td>
{{--                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->detailed_disposition }}</span></td>--}}
{{--                <td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ $row->fulfillment_center_id }}</span></td>--}}
                <td><span style="font-size: 85%;padding: .2em 0 .3em;white-space: pre-wrap;">{!! $row->reason !!}</span></td>
                <td><span style="font-size: 85%;padding: .2em 0 .3em;white-space: pre-wrap;">{!! $row->customer_comments !!}</span></td>
                <td>
                    {{--@if($row->status == 0 && \Encore\Admin\Facades\Admin::user()->can('complaint.calculate'))--}}
                        <a href="javascript:void(0);" class="my-modal" data-id="{{ $row->id }}"
                           data-action="editTag">
                            @if(!is_null($row->tag))
                                {!! implode("&nbsp;",\App\Models\Quality\QDictTag::getTag($row->tag)) !!}
                            @else
                                <i class="fa fa-pencil"></i>
                            @endif
                        </a>
                    {{--@else
                        @if(!is_null($row->tag))
                            <span style="font-size: 85%;padding: .2em 0 .3em;">{!! implode("&nbsp;",\App\Models\Quality\QDictTag::getTag($row->tag)) !!}</span>
                        @endif
                    @endif--}}
                </td>
                {{--<td><span style="font-size: 85%;padding: .2em 0 .3em;">{{ \App\Models\Amazon\FbaCustomerReturn::$_status[$row->status] }}</span></td>--}}
            </tr>
        @endforeach
        </tbody>
    </table>
</div>
<div class="modal fade" id="myModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <!-- 内容会加载到这里 -->
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script language="JavaScript" type="text/javascript">
    $(function () {
        //更新Tag
        $('.my-modal').on('click', function(e) {
            e.preventDefault();
            var id = $(this).data('id');
            var action = $(this).data('action');
            $("#myModal").modal({
                remote : '/xqc/quality/fba-customer-return-modal?action=' + action + '&param=' + id
            });
        });
        $("#myModal").on("hidden.bs.modal", function() {
            $(this).removeData("bs.modal");
            $(this).find(".modal-content").children().remove();
        });
    });
</script>
